# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pemcrack
pkgver=12.66e02b8
pkgrel=2
groups=('blackarch' 'blackarch-cracker')
pkgdesc='Cracks SSL PEM files that hold encrypted private keys. Brute forces or dictionary cracks.'
arch=('x86_64' 'aarch64')
url='https://github.com/robertdavidgraham/pemcrack'
license=('custom:unknown')
depends=('openssl')
makedepends=('git')
source=("git+https://github.com/robertdavidgraham/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  gcc "$pkgname.c" -lssl -lcrypto -Wall -o $pkgname
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

